package com.wcq.studentbackend.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class LoginResponseDTO {
    private String message;

    private String username; // 登录成功后的用户名/学号 (从 UserDetails 获取)

    private String name;     // 用户的显示姓名/昵称

    private String role;     // 'admin' or 'student' (从 LoginRequestDTO 获取)

    private List<String> authorities; // 用户的权限/角色列表 (例如 ["ROLE_ADMIN"])

    private String token;    // 新增的 JWT 字段

    // 手动添加一个包含 token 的构造函数
    public LoginResponseDTO(String message, String username, String name, String role, List<String> authorities, String token) {
        this.message = message;
        this.username = username;
        this.name = name;
        this.role = role;
        this.authorities = authorities;
        this.token = token;
    }
} 